/************************************* * File: Rectangle.h * Author: Katherine Gibson * Date: 2/16/2016 * Section: N/A * E-mail: k38@umbc.edu * Description: * This file contains the * declaration for a rectangle class *************************************/ // need to include these so string works using namespace std; #include const int DEFAULT_SIZE = 1; const string DEFAULT_COLOR = "none"; class Rectangle { public: // this constructor with default parameters can handle // Rectangle test; // Rectangle test(5); // Rectangle test(5, 6); // Rectangle test(5, "blue"); Rectangle(int width = DEFAULT_SIZE, int height = DEFAULT_SIZE, string color = DEFAULT_COLOR); void PrintInfo(); /**********************************/ /* methods of the Rectangle class */ /**********************************/ //------------------------------------------------------- // Name: CalcArea // Pre: m_width and m_height have been initialized // Post: returns the calculated area of the Rectangle //--------------------------------------------------------- int CalcArea(void); //------------------------------------------------------- // Name: CalcPerim // Pre: m_width and m_height have been initialized // Post: returns the calculated perimeter of the Rectangle //--------------------------------------------------------- int CalcPerim(void); //------------------------------------------------------- // Name: Rotate // Pre: m_width and m_height have been initialized // Post: switches m_width and m_height to "rotate" the Rectangle //--------------------------------------------------------- void Rotate(); //------------------------------------------------------- // Name: IsSquare // Pre: m_width and m_height have been initialized // Post: returns true if m_width and m_height are equal //--------------------------------------------------------- bool IsSquare(); int GetWidth(); int GetHeight(); string GetColor(); void SetWidth(int width); void SetHeight(int height); void SetColor(string color); private: /*************************************/ /* attributes of the Rectangle class */ /*************************************/ int m_width; int m_height; string m_color; };